package com.sviet.game.tetriswindow.database;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

public class BaseDao {

	protected Context context;
	
	protected DBHelper helper;
	
	protected SQLiteDatabase db;

	public BaseDao() {

	}

	public BaseDao(Context context) {
		this.context = context;
		this.helper = new DBHelper(context);
	}
	
	public void setContext(Context context) {
        this.context = context;
        this.helper = new DBHelper(context);
    }

    public  void open() {
        db = helper.getWritableDatabase();
    }
    
    public void close() {
        if (db != null && db.isOpen()) {
            db.close();
        }
    }
    
}
